# Contributor: psykose <alice@ayaya.dev>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=rdma-core
pkgver=41.0
pkgrel=0
pkgdesc="RDMA core userspace libraries and daemons"
url="https://github.com/linux-rdma/rdma-core"
license="GPL-2.0-only OR BSD-2-Clause"
arch="all !s390x !riscv64" # rv64 textrels, s390x ftbfs
options="!check" # tests are for installation
makedepends="
	cmake
	eudev-dev
	libdrm-dev
	libnl3-dev
	py3-docutils
	samurai
	"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://github.com/linux-rdma/rdma-core/releases/download/v$pkgver/rdma-core-$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
428d12d986effa0d58bc8b284fd5b7eab74fd484e1618cd3ebcfb1e4a142b5193fe4a7d305868d93bc44bcc591f08b81edfb0358c280111974a5335a79ae4f4c  rdma-core-41.0.tar.gz
"
